package com.ormbench.base.model;

import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="teller")
public class Teller extends BaseModel {
	
	@Basic
	@Column(name = "branch_id", nullable = false)
	private Long branchId;
	public Long getBranchId() { return branchId; }
	public void setBranchId(Long branchId) { this.branchId = branchId; }

	@ManyToOne(cascade = CascadeType.REMOVE)
    @JoinColumn(name = "branch_id", insertable=false, updatable=false)
	private Branch branch;
	public Branch getBranch() { return branch; }
	public void setBranch(Branch branch) { this.branch = branch; }

	@Basic
	@Column(name = "balance", nullable = true)
	private Integer balance;
	public Integer getBalance() { return this.balance; }
	public void setBalance(Integer balance) { this.balance = balance; }
	
	@Basic
	@Column(name = "filler", nullable = true, length = 128)
	private String filler;
	public String getFiller() { return this.filler; }
	public void setFiller(String filler) { this.filler = filler; }
	
	@OneToMany(mappedBy = "teller", cascade=CascadeType.REMOVE)
	private List<History> histories;
	public List<History> getHistories() { return histories; }
	public void setHistories(List<History> histories) { this.histories = histories; }
}
